import mongoose from "mongoose";

const homeApprovalSchema = new mongoose.Schema(
  {
    userId: {
      type: mongoose.Schema.Types.ObjectId,
      required: true,
      ref: "User",
    }, // 申请的用户id
    newName: { type: String, required: true }, // 申请修改的名称
    newImageUrl: { type: String, required: true }, // 申请修改的图片链接
    newVideoUrl: { type: String, required: true }, // 申请修改的视频链接
    status: {
      type: String,
      enum: ["已通过", "待审批", "未通过"],
      default: "待审批",
    }, // 审批状态
    remark: { type: String }, // 审批说明
  },
  { collection: "HomeApproval" }
);

const HomeApproval = mongoose.model("HomeApproval", homeApprovalSchema);

export default HomeApproval;
